<template>
	<view class="content">
		<u-navbar title="兑换券详情" :placeholder='true' height="88rpx" titleStyle='color:#fff;font-size:32rpx'
			leftIconColor="#fff" left-icon-size="32rpx" bg-color="#FF594D" :autoBack="true">
		</u-navbar>
		<!-- 		<view class="refund_content">
			<view class="member_info">
				<view class="order_info" @click="navigateTo('/pages_spell/pages/member-change/member-change')">
					<view class="info_item">
						<view class="left">名称</view>
						<view class="right">{{couponInfo.name}}</view>
					</view>
				</view>
				<view class="info_bar">
					<image src="../static/images/detail-page/gh_14cf42d05960_430.jpg" mode=""></image>
				</view>
			</view>
		</view> -->

		<view class="bar_code">
			<view class="bar_content">
				<view class="bar_title">
					{{couponInfo.name}}
				</view>
				<view class="bar_image">
					<view class="bilateral">
						<view class=""></view>
						<view class=""></view>
					</view>
					<view class="bar_code_image">
						<image
							:src=" baseUrl + '/files/' +couponInfo.verificationCode.split('/')[couponInfo.verificationCode.split('/').length-1]"
							mode=""></image>
					</view>
					<view class="bilateral">
						<view class=""></view>
						<view class=""></view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getCouponInfo
	} from '../../api/mine.js'
	import baseUrl from '../../utils/base.js'
	export default {
		onLoad(option) {
			this.getCouponData(option.id)
		},
		data() {
			return {
				couponInfo: {},
				baseUrl
			}
		},
		methods: {
			async getCouponData(id) {
				const res = await getCouponInfo(id)
				// console.log(res);
				this.couponInfo = res.data
			}
		}
	}
</script>

<style lang="scss">
	.content {
		background-color: #f3f3f3;
		height: 100vh;

		.refund_btn {
			width: 400rpx;
			height: 58rpx;
			background: #FF594D;
			border-radius: 98rpx 98rpx 98rpx 98rpx;
			text-align: center;
			line-height: 58rpx;
			font-size: 24rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			margin-top: 100rpx;
			margin-left: 175rpx;
		}

		// padding-top: 35rpx;
		.tab {
			background-color: #fff;
			// padding: 0 20rpx;
			padding: 0 20rpx;
			box-sizing: border-box;
		}

		.bar_code {
			padding: 20rpx 20rpx;

			.bar_content {
				background-color: #fff;
				padding: 20rpx;
				border-radius: 10rpx;

				.bar_title {
					font-size: 26rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					color: #333332;
				}
			}

			.bar_image {
				display: flex;
				align-items: center;
				justify-content: space-between;

				.bilateral {
					text-align: center;
				}

				.bar_code_image {
					width: 484rpx;
					// height: 154rpx;
					display: flex;
					padding-top: 30rpx;
					flex-wrap: wrap;
					align-content: center;
					justify-content: center;

					image {
						width: 300rpx;
						height: 300rpx;
					}

					view {
						font-size: 26rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 500;
						color: #000000;
						text-align: center;
						width: 100%;
					}
				}
			}
		}

		.refill_record {
			padding: 20rpx;

			.refill_content {
				background-color: #fff;
				padding: 20rpx;
				border-radius: 10rpx;

				.refill_title {
					font-size: 26rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #000000;
					padding-bottom: 14rpx;
				}

				.money_list {
					.money_item {

						font-size: 24rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #777777;

						.top {
							display: flex;
							justify-content: space-between;
							align-items: center;
							padding-bottom: 14rpx;

							.left {
								text {
									color: #FF594D;
								}
							}
						}

						.time {}
					}
				}
			}
		}

		.order_content_wrap {
			padding: 0 20rpx;
		}

		.refund_content {
			padding: 0 20rpx;

			.order_info {
				background-color: #fff;

				.info_item {
					width: 428rpx;
					display: flex;
					align-items: center;
					padding-bottom: 28rpx;
					justify-content: space-between;
					box-sizing: border-box;
					padding-right: 22rpx;

					&:last-of-type {
						padding-bottom: 0rpx;
					}

					.left {
						width: 200rpx;
						font-size: 26rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 500;
						color: #777777;
					}

					.right {
						font-size: 24rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #777777;
						display: flex;

						.updata {
							width: 101rpx;
							height: 34rpx;
							border-radius: 10rpx;
							font-size: 20rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							background-color: #FF594D;
							color: #FFFFFF;
							line-height: 30rpx;
							text-align: center;
							margin-left: 20rpx;
						}
					}

				}
			}

			.member_info {
				display: flex;
				background-color: #fff;
				border-radius: 20rpx;
				padding: 30rpx 20rpx;

				.info_bar {
					width: 230rpx;
					font-size: 20rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					color: #000000;
					text-align: center;
					padding-left: 20rpx;

					image {
						width: 230rpx;
						display: block;
						height: 230rpx;
					}
				}
			}
		}



		.line {
			padding: 20rpx 0;
		}
	}
</style>